<!--

Copyright 2012 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Google's Street Identity Console</title>

    <link rel="stylesheet" href="/static/blueprint/screen.css" type="text/css"
          media="screen, projection">
    <link rel="stylesheet" href="/static/blueprint/print.css" type="text/css"
          media="print">
    <link rel="stylesheet" href="/static/blueprint/src/forms.css" type="text/css"
          media="print">
    <!-- Import fancy-type plugin. -->
    <link rel="stylesheet" href="/static/blueprint/plugins/fancy-type/screen.css"
          type="text/css" media="screen, projection" />

    <!--[if lt IE 8]><link rel="stylesheet" href="../../blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->

    <link rel="stylesheet" href="/static/style.css" type="text/css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
    <script src="/static/scripts.js" type="text/javascript"></script>
</head>

<body>

<div class="container">

    <div id="header" class="span-22 last prepend-top">
        <a href="/"><img src="/static/google_streetidentity.png"
                         alt="Google Street Identity Project" /> </a>
    </div>

    <hr />
    <div id="subheader" class="span-18">
        <h3 class="alt">
            <strong>Street Identity Console</strong> allows you to view your registered verified information.
        </h3>
    </div>
    <div id="subheader2" class="span-6 last">
        <p class="text right">
            <a href="/account">Your Account</a>  <a href="/sign_out">Sign out</a>
        </p>
    </div>
    <hr />
    <div class="span-15 colborder">
        <div class="span-15 last">
            <h3>Your registered applications</h3>

            {% if application_list_empty %}
            {% for application in application_list %}

            <div class="span-15 last app-box">
                <div class="left">
                    <p><strong>{{ application.name }}</strong> ({{ application.url }}) <br />
                    Client ID: {{ application.client_id }} </p>
                    <form action="/developer/remove" method="post" id="remove_application">
                    <input type="hidden" name="app_id" value="{{ application.key() }}"/>
                    <a href="#" onclick="document.getElementById('remove_application').submit();">Remove</a>
                    </form>
                    </div>

                <div class="right"><img src='/icon?app_id={{ application.key() }}' alt="{{ application.name }} icon" /></div>
            </div>
            {% endfor %}
            {% else %}
            <p>You do not have any registered Street Identity applications.<br /><br /></p>
            {% endif %}

            <p>
            <input type="submit" value="Register Application" id="add_application_button" class="button"/>
            <input type="submit" value="Hide Application Registration" id="hide_application_button" class="button" style="display: none;"/>
            </p>

            <br />
            <form id="add_application" action="/developer" method="post"
                  class="box" enctype="multipart/form-data" style="display: none;">

                <fieldset>
                    <legend>Register New Application</legend>

                    <div class="notice text">You need to provide details of your application that has been already registered with the Google API console. Please copy the required information from <a href="https://code.google.com/apis/console">Google API Console</a>.
                    </div>
                    
                    <p>
                        <label for="name">Name</label><br> <input type="text"
                                                                  class="text" id="name" name="name">
                    </p>
                    <p>
                        <label for="client_id">Client ID</label><br> <input type="text"
                                                                            class="text" id="client_id" name="client_id">
                    </p>
                    <p>
                        <label for="url">URL</label><br> <input type="text"
                                                                class="text" id="url" name="url">
                    </p>
                    <p>
                        <label for="icon">Icon</label><br> <input type="file"
                                                                  class="text" id="icon" name="icon">
                    </p>

                    <input type="submit" value="Register Application" class="button"> <input
                        type="reset" value="Reset" class="button">
                </fieldset>
            </form>

        </div>
    </div>
    <div class="span-7 last">
        <img src="/static/streetidentity-idp.png"
             alt="Google Street Identity Provider" usemap="#streetidentitymap"/>

        <map name="streetidentitymap">
            <area shape="rect" coords="78,7,291,76" alt="Street Identity Console" href="https://streetidentity-console.appspot.com" />
            <area shape="rect" coords="4,220,140,261" alt="Street Identity RP" href="https://streetidentity-rp-demo.appspot.com" />
            <area shape="rect" coords="125,276,303,319" alt="Street Identity AP" href="https://streetidentity-ap-demo.appspot.com" />
        </map>
    </div>
    <hr />
    <div class="span-10 left">
        <p class="text">
            <a href="http://code.google.com/p/streetidentity/">Street Identity Project</a>
        </p>
    </div>
    <div class="span-3 last right">
        <img src="/static/google_logo_small.png" alt="Google Inc." align="right" />
    </div>
</div>

</body>
</html>
